<?php

/**
 * ProduitEnCommandeViaMenu form base class.
 *
 * @method ProduitEnCommandeViaMenu getObject() Returns the current form's model object
 *
 * @package    ProjetBar
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseProduitEnCommandeViaMenuForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_commande_client'       => new sfWidgetFormInputHidden(),
      'id_commande_menu'         => new sfWidgetFormInputHidden(),
      'id_produit'               => new sfWidgetFormInputHidden(),
      'id_etat_produit_en_vente' => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'id_commande_client'       => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_commande_client')), 'empty_value' => $this->getObject()->get('id_commande_client'), 'required' => false)),
      'id_commande_menu'         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_commande_menu')), 'empty_value' => $this->getObject()->get('id_commande_menu'), 'required' => false)),
      'id_produit'               => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_produit')), 'empty_value' => $this->getObject()->get('id_produit'), 'required' => false)),
      'id_etat_produit_en_vente' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_etat_produit_en_vente')), 'empty_value' => $this->getObject()->get('id_etat_produit_en_vente'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('produit_en_commande_via_menu[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ProduitEnCommandeViaMenu';
  }

}
